import 'package:flutter/material.dart';

class StateFullCase extends StatefulWidget {
  const StateFullCase({Key? key, required this.title}) : super(key: key);
  final String title;
  @override
  _StateFullCaseState createState() => _StateFullCaseState();
}

class _StateFullCaseState extends State<StateFullCase> {
  int count = 0;
  @override
  Widget build(BuildContext context) {
    return Container(
        child: Column(
      children: [
        Text(widget.title),
        Row(
          children: [
            ElevatedButton(
                onPressed: () {
                  setState(() {
                    count--;
                  });
                },
                child: Text('-')),
            Text(
              count.toString(),
              style: TextStyle(color: Colors.greenAccent, fontSize: 40),
            ),
            ElevatedButton(
                onPressed: () {
                  setState(() {
                    count++;
                  });
                },
                child: Text('+'))
          ],
        ),
      ],
    ));
  }
}
